﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QLNS.Models
{
    public class TKTDDT_CBCCModels
    {
        public static List<tkTDDT_CBCC> GetAll()
        {

            //khoi tao db
            ITAPMNS2013Entities context = new ITAPMNS2013Entities();

            var query = from dt in context.DStkTDDT_CBCC                        
                        select dt;
            return query.ToList<tkTDDT_CBCC>();
        }
        public static List<tkTDDT_CBCC> GetAllChild(int idparent)
        {

            //khoi tao db
            ITAPMNS2013Entities context = new ITAPMNS2013Entities();

            var query = from dt in context.DStkTDDT_CBCC
                        where dt.IDParent == idparent
                        orderby dt.STT ascending
                        select dt;
            return query.ToList<tkTDDT_CBCC>();
        }
    }
}